<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>调查设计</title>
</head>
<body>
	<%@ include file="header.jspf"%>
	<br />
	<br />
	<br />
	<s:if test="logoPhoto!=null">
		<img alt="logo" src='<s:url value="%{logoPhoto}"/>' width="30" height="25"/>
	</s:if>
	<br /> 调查名称：
	<s:property value="title" />
	<s:set var="sid" value="%{id}" />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<s:a action="pageAction_toAddPage?sid=%{#sid}" namespace="/">增加页</s:a>
	<br />
	<s:iterator value="pages" var="p">
		<s:hidden name="id" value="#p.id"></s:hidden>
		页面名称：<s:property value="#p.title" />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<s:if test="#p.description !=null">
		页面描述：<s:property value="#p.description" />
		</s:if>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<s:a action="pageAction_editPage?id=%{#p.id}&sid=%{#sid}"
			namespace="/">编辑页面</s:a>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<s:a action="pageAction_deletePage?id=%{#p.id}&sid=%{#sid}"
			namespace="/">删除页面</s:a>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<s:a action="questionAction_toSelectQtPage?pid=%{#p.id}&sid=%{#sid}"
			namespace="/">增加问题</s:a>
		<br />
		<s:iterator value="#p.questions" var="q">
			<s:set value="#q.questionType" var="qt"></s:set>
			问题标题：<s:property value="#q.title" /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<s:a
				action="questionAction_editQuestion?pid=%{#p.id}&sid=%{#sid}&id=%{#q.id}"
				namespace="/">编辑问题</s:a>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<s:a
				action="questionAction_deleteQuestion?pid=%{#p.id}&sid=%{#sid}&id=%{#q.id}"
				namespace="/">删除问题</s:a>
			<br />
			<s:if test="#qt < 4">
				<s:iterator value="#q.optionsArr">
					<input type='<s:property value="#qt < 2?'radio':'checkbox'"/>'
						name="qt1" />
					<s:property />
					<s:if test="#qt==1||#qt==3">
						<br />
					</s:if>
				</s:iterator>
				<s:if test="#q.other">
					<input type='<s:property value="#qt < 2?'radio':'checkbox'"/>'
						name="qt1" />其他:
						<s:if test="#q.otherStyle==1">
						<s:textfield></s:textfield>
					</s:if>
					<s:else>
						<select>
							<s:iterator value="#q.otherSelectOptionsArr">
								<option value='<s:property/>'><s:property /></option>
							</s:iterator>
						</select>
					</s:else>
				</s:if>
			</s:if>
			<s:elseif test="#qt == 4">
				<select>
					<s:iterator value="#q.optionsArr">
						<option value='<s:property/>'><s:property /></option>
					</s:iterator>
				</select>
			</s:elseif>
			<s:elseif test="#qt == 5">
				<input type="text" />
			</s:elseif>

			<s:elseif test="#qt>5">
				<table border="1">
					<tr>
						<td></td>
						<s:iterator value="#q.matrixRowTitleArrs">
							<td><s:property /></td>
						</s:iterator>
						<s:if test="#q.other">
							<td>其他</td>
						</s:if>
					</tr>
					<s:iterator value="#q.matrixColTitleArrs">
						<tr>
							<td><s:property /></td>
							<s:iterator value="#q.matrixRowTitleArrs">
								<s:if test="#qt<8">
									<input type='<s:property value="#qt==6?'radio':'checkbox'"/>' />
								</s:if>
								<s:else>
									<select>
										<s:iterator value="#q.matrixSelectOptionArr">
											<option value='<s:property/>'></option>
										</s:iterator>
									</select>
								</s:else>
							</s:iterator>
							<s:if test="#q.other">
								<s:if test="#qt<8">
									<input type='<s:property value="#qt==6?'radio':'checkbox'"/>' />
								</s:if>
								<s:else>
									<select>
										<s:iterator value="#q.otherSelectOptionsArr">
											<option value='<s:property/>'><s:property /></option>
										</s:iterator>
									</select>
								</s:else>
							</s:if>
						</tr>
					</s:iterator>

				</table>
			</s:elseif>
			<br />
		</s:iterator>

	</s:iterator>
</body>
</html>